/*WAP to Check whether matrix is a symmetrix or not*/

#include<stdio.h>
#include<conio.h>
#include<math.h>
void TransposeMatrix(int *arr, int *arrt, int, int);
void main()
{
	int arr[3][3] = {
						{1, 2, 3},
						{3, 4, 5},
						{9, 8, 7}
					};

	int i, j, arrt[3][3], k = 0;

	clrscr();

	TransposeMatrix(&arr[3][3], &arrt[3][3]);

	//Print the transposed Matrix                                                                                                                                                              22
	for(i = 0; i <= 2; i++)
	{
		for(j = 0; j <= 2; j++)
		{
			printf("\t%d", arrt[i][j]);
		}
		printf("\n");
	}
	printf("\n\n\n\n\n");
	//Check the transposed Matrix is Symmetric (arr = arrt)
	for(i = 0; i <= 2; i++)
	{
		for(j = 0; j <= 2; j++)
		{
			if(arrt[i][j] != arr[i][j])
			{
				k = 1;
				break; /*If it gets mismatch, it will take k = 1 after then
				it will break the 1st loop(j)*/
			}
		}
		if(k == 1)	break;
	}

	if(k == 1)
	{
		printf("\n\n\t\tIt is not a Symmetric Matrix");
	}

	else
	{
		printf("\n\n\t\tIt is a Symmetric Matrix");
	}

	getch();

}

void TransposeMatrix(int *arr[3][3], int *arrt[3][3], int row, int col)
{
	int i, j;
	//Transpose the Matrix
	for(i = 0; i < row; i++)
	{
		for(j = 0; j < col; j++)
		{
			//arrt[j][i] = arr[i][j];
		}
	}
}
